-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
nice -n huge_num true #10213
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nice -n huge_num true #10213
Conversation
eec8ae2 to
ae0c818
Compare
|
GNU testsuite comparison: |
4ce1311 to
7a75ddd
Compare
|
GNU testsuite comparison: |
| fn test_nice_huge() { | ||
| new_ucmd!() | ||
| .args(&[ | ||
| "-n", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Only positive overflow is tested. Should add a test for negative overflow (e.g., -999...9) to ensure both clamping directions work.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Negative is root test, would not work on the CI.
...
Oh yes. It should work with permission denied.
fae9d13 to
0166306
Compare
|
GNU testsuite comparison: |
d7cd76f to
07d3f52
Compare
src/uu/nice/src/nice.rs
Outdated
| translate!("nice-error-invalid-number", "value" => nstr.clone(), "error" => e), | ||
| )); | ||
| // clamp huge values | ||
| let trimmed = nstr.trim(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think moving it into a function could help with readability
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this operation duplicated at somethere?
Merging this PR will not alter performance
Comparing Footnotes
|
|
GNU testsuite comparison: |
27be172 to
b114e0a
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
858f4f0 to
7d3c2ad
Compare
|
GNU testsuite comparison: |
917605c to
34c2172
Compare
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
Closes #10200